package com.ccsc.auth.entity.vo;

import com.google.common.base.Joiner;
import com.google.common.collect.Lists;

import java.util.List;

/**
 * 用户
 * Created by XingWen on 2017/2/8.
 */
public class UserVo {

    private Integer id;//用户id
    private String account;//用户账号
    private String name;//姓名
    private String password;//用户密码
    private Integer sex;//用户性别
    private String mail;//邮箱
    private String phone;//电话
    private Integer status;//状态
    private List<RoleVo> roles;//角色id
    private String roleStr;
    private Integer departmentId;//部门id
    private String departmentName;//部门name
    private Integer positionId;//职位id
    private String positionName;//职位name
    private Integer rdopId;//部门职位id
    private Integer num;//序号

    /**
     * 多了两个字段
     * @return
     */
    //是否选择电话方式
    private Integer phoneVerify=0;
    //如果是ip方式 ipVerify.size()>0 则填写ip段 并且填入数据
    private List<List<String>> ipVerify;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public String getMail() {
        return mail;
    }

    public void setMail(String mail) {
        this.mail = mail;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public List<RoleVo> getRoles() {
        return roles;
    }

    public void setRoles(List<RoleVo> roles) {
        this.roles = roles;
    }

    public Integer getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(Integer departmentId) {
        this.departmentId = departmentId;
    }

    public String getDepartmentName() {
        return departmentName;
    }

    public void setDepartmentName(String departmentName) {
        this.departmentName = departmentName;
    }

    public Integer getPositionId() {
        return positionId;
    }

    public void setPositionId(Integer positionId) {
        this.positionId = positionId;
    }

    public String getPositionName() {
        return positionName;
    }

    public void setPositionName(String positionName) {
        this.positionName = positionName;
    }

    public Integer getRdopId() {
        return rdopId;
    }

    public void setRdopId(Integer rdopId) {
        this.rdopId = rdopId;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public String getRoleStr() {
        List<String> rstr = Lists.newArrayList();
        if(roles!=null && roles.size()>0){
            for(RoleVo role : roles){
                rstr.add(role.getName());
            }
        }
        return Joiner.on(",").join(rstr);
    }

    public void setRoleStr(String roleStr) {
        this.roleStr = roleStr;
    }

    public Integer getPhoneVerify() {
        return phoneVerify;
    }

    public void setPhoneVerify(Integer phoneVerify) {
        this.phoneVerify = phoneVerify;
    }

    public List<List<String>> getIpVerify() {
        return ipVerify;
    }

    public void setIpVerify(List<List<String>> ipVerify) {
        this.ipVerify = ipVerify;
    }
}
